﻿Type.registerNamespace("EventCounter");

EventCount = 0

// Override ObjectWithEvents.fireEvent
Original_ObjectWithEvents_fireEvent = Tridion.ObjectWithEvents.prototype.fireEvent;
Tridion.ObjectWithEvents.prototype.fireEvent = function ObjectWithEvents$fireEvent(event, eventData) {
    Original_ObjectWithEvents_fireEvent.call(this, event, eventData);
    EventCount++;
    if (EventCount % 100 == 0) {
        Tridion.Cme.MessageCenter.registerNotification(EventCount + " events have been fired");
    }
}
